package com.imooc.implicit_app

import java.io.File
import ImplicitAspect._

object ImplicitApp extends App{


  val man = new Man("PK")
  man.eat
  man.fly


  val file = new File("/home/lynn/桌面/scala/scala_note.txt")
  val txt = file.read()
  println(txt)
}

class Man(val name:String){

  def eat: Unit ={
    println(s"man [ $name ] eat ... ")
  }

}

class SuperMan(val name:String){

  def fly(): Unit ={
    println(s"superman [ $name ] fly ... ")
  }

}

class RichFile(val file:File){

  def read(): String ={
    scala.io.Source.fromFile(file.getPath).mkString
  }

}
